#include "GUIShape.h"

struct GUIVertex
{
	float x, y, z, u, v;
};

GUIShape::GUIShape() : m_vertexContainer( new IVertexContainer( VertexDeclaration(2, VertexType(0, 3, enumPosition), VertexType(12, 2, enumTexCoord0)) ))
{	
	VertexContainer<GUIVertex>* vc = (VertexContainer<GUIVertex>*)(m_vertexContainer.getPointer());
	vc->resize(6);

	vc->getVertices()[0].u = 0.0f;
	vc->getVertices()[0].v = 0.0f;
	vc->getVertices()[0].x = 0.0f;
	vc->getVertices()[0].y = 0.0f;
	vc->getVertices()[0].z = -1.0f;
	//vc->getVertices()[0].r = 128;
	//vc->getVertices()[0].g = 128;
	//vc->getVertices()[0].b = 128;
	
	vc->getVertices()[1].u = 0.0f;
	vc->getVertices()[1].v = 1.0f;
	vc->getVertices()[1].x = 1.0f;
	vc->getVertices()[1].y = 1.0f;
	vc->getVertices()[1].z = -1.0f;
	//vc->getVertices()[1].r = 128;
	//vc->getVertices()[1].g = 128;
	//vc->getVertices()[1].b = 128;
	
	vc->getVertices()[2].u = 1.0f;
	vc->getVertices()[2].v = 1.0f;
	vc->getVertices()[2].x = 0.0f;
	vc->getVertices()[2].y = 1.0f;
	vc->getVertices()[2].z = -1.0f;
	//vc->getVertices()[2].r = 128;
	//vc->getVertices()[2].g = 128;
	//vc->getVertices()[2].b = 128;
	


	vc->getVertices()[3].u = 0.0f;
	vc->getVertices()[3].v = 0.0f;
	vc->getVertices()[3].x = 0.0f;
	vc->getVertices()[3].y = 0.0f;
	vc->getVertices()[3].z = -1.0f;
	//vc->getVertices()[3].r = 128;
	//vc->getVertices()[3].g = 128;
	//vc->getVertices()[3].b = 128;
	
	vc->getVertices()[4].u = 1.0f;
	vc->getVertices()[4].v = 1.0f;
	vc->getVertices()[4].x = 1.0f;
	vc->getVertices()[4].y = 1.0f;
	vc->getVertices()[4].z = -1.0f;
	//vc->getVertices()[4].r = 128;
	//vc->getVertices()[4].g = 128;
	//vc->getVertices()[4].b = 128;
	
	vc->getVertices()[5].u = 1.0f;
	vc->getVertices()[5].v = 0.0f;
	vc->getVertices()[5].x = 1.0f;
	vc->getVertices()[5].y = 0.0f;
	vc->getVertices()[5].z = -1.0f;
	//vc->getVertices()[5].r = 128;
	//vc->getVertices()[5].g = 128;
	//vc->getVertices()[5].b = 128;
}


Pointer<IVertexContainer>& GUIShape::getShape()
{
	return m_vertexContainer;
}